set f=$1:t
set m=m:"$f"
if (-e $1:r.bak) rm $1:r.bak
if ($1:r.c == $1) then
  cspiff -o $m $1
  mv $1 $1:r.bak
  mv $m $1
else if ($1:r.h == $1) then
  cspiff -o $m $1
  mv $1 $1:r.bak
  mv $m $1
else if ($1:r.s == $1) then
  aspiff -o $m $1
  mv $1 $1:r.bak
  mv $m $1
else 
  echo csh:unknown file type $1
endif
